<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>上机管理</title>

</head>
<body>

    <h1 style="font-size: 100px;color: red;text-align: center">上机管理页面<h1>
        <script type="text/javascript">
            function beforeSubmit(form){
                if(form.username.value==''){
                    alert('用户名不能为空！');
                    form.username.focus();
                    return false;
                }
                if(form.password.value==''){
                    alert('密码不能为空！');
                    form.password.focus();
                    return false;
                }
                if(form.password.value.length<6){
                    alert('密码至少为6位，请重新输入！');
                    form.password.focus();
                    return false;
                }
                if(form.password.value!=form.password2.value) {
                    alert('你两次输入的密码不一致，请重新输入！');
                    form.password2.focus();
                    return false;
                }
                window.location.href="shangjiguanli.jsp";
                return true;
            }
        </script>

        <fieldset>
            <legend>上机</legend>
            <form method="post" name="form" action="shangjiguanli.jsp" onSubmit="return beforeSubmit(this);">
                <table border="1" width="100%" cellspacing="0" cellpadding="0">
                    <tr><td><label>卡 号：<input type="text" name="username" value=""></label></td></tr>
                    <tr><td><label>密   码：<input type="password" name="password" value=""></label></td></tr>
                    <tr><td><label>重复密码：<input type="password" name="password2" value=""></label></td></tr>
                    <tr><td><input value="登录" type="submit"> <input type="reset" value="重置"></td></tr>
                </table>
            </form>
        </fieldset>


        <br>
        <h2 align="center">
            <a href="main.jsp">返回主页面</a>
        </h2>

</body>
</html>